org.eclipse.vtp.desktop.core.actions.util
Class InternalActionSet

java.lang.Object
  extended by org.eclipse.vtp.desktop.core.actions.util.InternalActionItem
      extended by org.eclipse.vtp.desktop.core.actions.util.InternalActionSet
All Implemented Interfaces:
InternalActionItemContainer, IProvisioningActionItem, IProvisioningActionSet

public class InternalActionSet
extends InternalActionItem
implements IProvisioningActionSet, InternalActionItemContainer

This is a concrete menu/sub-menu implementation of the IProvisioningActionSet and InternalActionItemContainer interfaces and provides the default behavior of those interfaces.

Version:
2.0
Author:
Trip Gilman

Field Summary
 
Fields inherited from class org.eclipse.vtp.desktop.core.actions.util.InternalActionItem
pluginNameSpace
 
Constructor Summary
InternalActionSet(java.lang.String containerId, java.lang.String name)
          Creates a new InternalActionSet with the given container id and name.
 
Method Summary
 boolean addActionItem(InternalActionItem actionItem)
          Adds the given action item to the list of items contained in this sub-menu.
 boolean addSection(InternalActionSetSection section)
          Adds the given section to this action set.
 void fillContextMenu(org.eclipse.jface.action.IMenuManager menuManager)
          Adds this containers actions and child containers to the given menu manager.
 InternalActionItemContainer findContainer(java.util.Stack ids)
          Locates the container with the given set of ids.
 void processSelectionChange(IProvisioningModelSelection selection)
          Notifies the action (and filter) that the selection has changed.
 void setSorter(IProvisioningActionItemSorter sorter)
          Associates the given sorter with this action set.
 
Methods inherited from class org.eclipse.vtp.desktop.core.actions.util.InternalActionItem
getAvailability, getContainerId, getCurrentSelection, getName, getToolTip, setFilterClass, setName, setPluginNameSpace, setTargetClass, setToolTip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.core.actions.util.IProvisioningActionItem
getName, getToolTip
 

Constructor Detail

InternalActionSet

public InternalActionSet(java.lang.String containerId,
                         java.lang.String name)
Creates a new InternalActionSet with the given container id and name.

Parameters:
containerId - The id of this action set
name - The name of this action set
Method Detail

setSorter

public void setSorter(IProvisioningActionItemSorter sorter)
Associates the given sorter with this action set. The sorter is used to organize the action items contained by this action set.

Parameters:
sorter - the new sorter

addActionItem

public boolean addActionItem(InternalActionItem actionItem)
Description copied from interface: InternalActionItemContainer
Adds the given action item to the list of items contained in this sub-menu.

Specified by:
addActionItem in interface InternalActionItemContainer
Parameters:
actionItem - The item to add.
Returns:
true if the action was added, false if another action with the same name is already contained

addSection

public boolean addSection(InternalActionSetSection section)
Adds the given section to this action set. Sections are displayed using separators in the menus. The section can have an optional contraint that places it relative to another section.

Parameters:
section - The section to add
Returns:
true if the section was added successfully, false if the section name already exists in this action set

findContainer

public InternalActionItemContainer findContainer(java.util.Stack ids)
Description copied from interface: InternalActionItemContainer
Locates the container with the given set of ids. The ids are listed in parent first order. If the current id matches this container, the id is removed and the next id is matched against it's children. If a matching child is found the remaining ids are passed to the child container's implementation of this function.

Specified by:
findContainer in interface InternalActionItemContainer
Parameters:
ids - A Stack of id strings
Returns:
The container with the given id and heritage

processSelectionChange

public void processSelectionChange(IProvisioningModelSelection selection)
Description copied from class: InternalActionItem
Notifies the action (and filter) that the selection has changed. This may cause the state of the action to change.

Overrides:
processSelectionChange in class InternalActionItem
Parameters:
selection - The new user selection

fillContextMenu

public void fillContextMenu(org.eclipse.jface.action.IMenuManager menuManager)
Description copied from interface: InternalActionItemContainer
Adds this containers actions and child containers to the given menu manager. All enabled and disable actions are added. Any action with the absent state are skipped.

Specified by:
fillContextMenu in interface InternalActionItemContainer